x86/arm/mm: use gfn instead of pfn in p2m_{get,set}_mem_access
authorVitaly Kuznetsov <vkuznets@redhat.com>
Fri, 10 Jul 2015 11:58:24 +0000 (13:58 +0200)
committerJan Beulich <jbeulich@suse.com>
Fri, 10 Jul 2015 11:58:24 +0000 (13:58 +0200)
commit3b9bfeb1e7e506fd2dc078e7db7af07e45fd56da
tree52ce4492b2f886171e9c3bc4dde7f67b92c3f44a
parent968099c0a87c11b04e7428109642eac55e77ea74
x86/arm/mm: use gfn instead of pfn in p2m_{get,set}_mem_access

'pfn' and 'start_pfn' are ambiguous, both these functions expect GFNs as input.

On x86 the interface of p2m_set_mem_access() in p2m.c doesn't match the
declaration in p2m-common.h as 'pfn' is being used instead of 'start_pfn'.

On ARM both p2m_set_mem_access and p2m_get_mem_access interfaces don't match
declarations from p2m-common.h: p2m_set_mem_access uses 'pfn' instead of
'start_pfn' and p2m_get_mem_access uses 'gpfn' instead of 'pfn'.

Convert p2m_get_mem_access/p2m_set_mem_access (and __p2m_get_mem_access on ARM)
interfaces to using gft_t instead of unsigned long and update all users of
these functions.

There is also an issue in p2m_get_mem_access on x86: 'gfn' parameter passed to
gfn_lock/gfn_unlock is not defined. This code compiles only because of a
coincidence: gfn_lock/gfn_unlock are currently macros which don't use their
second argument.

Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Reviewed-by: George Dunlap <george.dunlap@eu.citrix.com>
Reviewed-by: Julien Grall <julien.grall@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
xen/arch/arm/p2m.c
xen/arch/x86/mm/p2m.c
xen/common/mem_access.c
xen/include/xen/p2m-common.h